package com.gaattc.service;

import com.gaattc.dao.AdminDao;
import com.gaattc.dao.AdminDaoImpl;
import com.gaattc.model.Admin;
import com.gaattc.model.bo.AdminLoginBO;
import com.gaattc.model.bo.ChangePwdBO;

import java.sql.SQLException;
import java.util.List;

public class AdminServiceImpl implements AdminService {

    private AdminDao adminDao = new AdminDaoImpl();

    @Override
    public int login(AdminLoginBO loginBO) {

        return adminDao.login(loginBO);
    }

    @Override
    public List<Admin> allAdmins() {

        return adminDao.allAdmins();
    }

    @Override
    public Admin getAdminsInfo(int id) {
        return adminDao.getAdminsInfo(id);
    }

    @Override
    public int addAdmins(Admin admin){
        return adminDao.addAdmins(admin);
    }

    @Override
    public int updateAdminss(Admin admin) {
        return adminDao.updateAdminss(admin);
    }

    @Override
    public int deleteAdmins(int id) {
        return adminDao.deleteAdmins(id);
    }

    @Override
    public List<Admin> getSearchAdmins(Admin admin) {
        return adminDao.getSearchAdmins(admin);
    }

    @Override
    public int changePwd(ChangePwdBO changePwdBO) {
        return adminDao.changePwd(changePwdBO);
    }
}
